function addSetUint() {//添加加工单位
    var index = layer.open({
        type: 2,
        title: '添加加工单位',
        area: ['60%', '60%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/add_unit'
    });
    this.layerIndex = index;
}

function addPicker() {//添加取件人
    var index = layer.open({
        type: 2,
        title: '添加取件人',
        area: ['60%', '60%'], //宽高
        fix: true, //不固定
        maxmin: true,
        content: Feng.ctxPath + '/doctorLooked/add_picker'
    });
    this.layerIndex = index;
}

function getProcessInfo() {
    var seleteProcessUnitValue = $('#processUnit').val();
    if (seleteProcessUnitValue != "") {
        $("#processUnit option[value='" + seleteProcessUnitValue + "']").attr("selected", "selected");
    }
}

function getPickerInfo() {
    var seletePickerValue = $('#picker').val();
    if (seletePickerValue != "") {
        $("#picker option[value='" + seletePickerValue + "']").attr("selected", "selected");
    }
}

function time() {//初始化赋值时间
    var time = new Date();
    var month = time.getMonth() + 1;
    var day = time.getDate();
    var hour = time.getHours();
    var minutes = time.getMinutes();
    if (month < 10) {month = "0" + month}
    if (day < 10) {day = "0" + day}
    if (hour < 10) {hour = "0" + hour}
    if (minutes < 10) {minutes = "0" + minutes}
    $("#deliveryTime").val(time.getFullYear() + "-" + month + "-" + day + " " + hour + ":" + minutes); //送件时间
    $("#pickUpTime").val(time.getFullYear() + "-" + month + "-" + day + " " + hour + ":" + minutes);  //取件时间
}

$(function () {
    getProcessInfo();
    getPickerInfo();
    time();
    var seleteDoctorValue = $('#userName').val();
    if (seleteDoctorValue != "") {
        $("#doctor1 option[value='" + seleteDoctorValue + "']").attr("selected", "selected");
    }
    var seleteStoreValue = $('#storeValue').val();
    if (seleteStoreValue != "") {
        $("#store option[value='" + seleteStoreValue + "']").attr("selected", "selected");
    }
    var payServiceNameMValue = $('#payServiceNameM').val();
    if (payServiceNameMValue != "") {
        $("#payServiceNameM option[value='" + payServiceNameMValue + "']").attr("selected", "selected");
    }
});